package com.system.user.controller;

import com.system.user.entity.User;
import com.system.user.service.IUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by nipin on 16/12/15.
 */
@Controller(value = "/user")
public class UserController {

    private static final Logger log = LoggerFactory.getLogger(UserController.class);
    @Autowired
    private IUserService userService;

    @RequestMapping(value = "/")
    public String indexPage(){
        return  null;
    }

    /**
     * 登录
     * @return
     */
    @RequestMapping(value = "/login")
    public String signIn(){
        return null;
    }

    /**
     * 注册
     * @return
     */
    @RequestMapping(value = "/signUp")
    public String signUp(User user){
        log.info("[system_user] checkin signUp");
        int count = userService.insert(user);
        if (count > 0){

        }else{

        }
        return "forward:/user/login";
    }
}
